home *** CD-ROM | disk | FTP | other *** search
- /*
- ** $VER: checkver.rexx 1.1 (29.8.96)
- ** by Eirik Nicolai Synnes
- **
- ** Companion script for SortMail installation. Should only be called if
- ** ENV:Thor/SortMail.cfg exists.
- **
- */
-
- options results
-
- found = 0
-
- cfgopen = open(cfg, 'ENV:Thor/SortMail.cfg', 'R')
- if cfgopen then do until eof(cfg)
- entry = readln(cfg)
- select
- when upper(subword(entry, 1, 1)) = "SYSTEM" then found = 1
- when upper(subword(entry, 1, 1)) = "GLOBAL" then found = 2
- otherwise nop
- end
- if found ~= 0 then break
- end
- else exit(30)
-
- call close(cfg)
-
- if found = 2 then do
- /* Find/open BBSREAD ARexx port */
-
- if ~show('P', 'BBSREAD') then do
- address(command)
- 'Run >NIL: `GetEnv THOR/THORPath`bin/LoadBBSRead'
- 'SYS:RexxC/WaitForPort BBSREAD'
- if rc ~= 0 then exit(30)
- end
-
- address(bbsread)
- 'READARGS TEMPLATE "SYSTEM/K,CONFERENCE/A,STATISTICS/S,NOWARN/S,LOGINSTATE/S" STEM 'globalcfg' CMDLINE 'subword(entry, 2)
- if rc ~= 0 then exit(rc)
-
- 'GETBBSDATA "'globalcfg.SYSTEM'" 'bbsdata
- if rc ~= 0 then exit(rc)
-
- bbsdata.BBSPATH = strip(bbsdata.BBSPATH, 'T', '/')
-
- if ~exists(bbsdata.BBSPATH) then exit(30)
-
- address command 'Copy ENV:Thor/SortMail.#? 'bbsdata.BBSPATH' QUIET CLONE'
- if rc ~= 0 then exit(30)
- address command 'Delete ENV:Thor/SortMail.#? ENVARC:Thor/SortMail.#? QUIET FORCE'
- if rc ~= 0 then exit(30)
-
- envopen = open(env, 'ENV:SM_System', 'W')
- if envopen then do
- call writeln(env, bbsdata.BBSPATH)
- call close(env)
- end
- else exit(30)
- end
-
- exit(found)
-